package com.jk.hly.demo.test;

import org.junit.Test;

public class LxController {

    static  int  len=0;
    static  int  i=0;
    static  int  maxNum=0;
    static boolean boo;
    static  char   ch;

    @Test
    public static void main(String[] args) {
        int  a=0;
        int  sum=test01(a);


        int  numArr[]={1,3,5,18,10};
        len=numArr.length-1;
        find(maxNum,i,numArr);

       // System.out.println((1+500)*500/2);// (1+n)*n/2
      //  System.out.println(sum);
       // System.out.println(3-2.4==0.6);
        //System.out.println(boo);
        //System.out.println(ch);
    }

    private static void find(int maxNum, int i, int[] numArr) {
        if(numArr[i]>maxNum) {
            maxNum=numArr[i];
        }

        if(len>i){
            ++i;
            find(maxNum,i,numArr);
        }else{
            System.out.println(maxNum);
        }
    }

    static int  b=0;

    private static int test01(int a) {

        b+=a;
        b = a==500 ? b : test01(++a);
        return  b;

    }

}
